I typed this in wrong, it should be
z -= TheFrame->GCodeDlg.Interpreter->p_setup->tool_length_offset;
For the benefit of those not using tool offset tables, let me explain how they work. Tool-1 will be your probe. You touch off of the table surface and set your Z to zero. Next, you insert your tools one by one and touch off the surface. The Z reading you get on contact is your tool offset entered into the table.
For a tool change to tool-2, your G code would have something like:
T2 G43 H2 (change to tool-2 and apply the tool offset for tool 2)
KMotionCNC will subtract your tool offset from the current Z reading. Say your tool-2 offset is -1.000, (in other words, your probe would have been 1" longer than tool-2). When the tool change occurs, the offset will be applied and the Z dro will now read 1.000. The spindle will need to drop 1" for the tool to make contact with the datum surface.
--- In DynoMotion@yahoogroups.com, "eric_kato_sanders" <eric@...> wrote:
>
>
>
> --- In DynoMotion@yahoogroups.com, "eric_kato_sanders" <eric@> wrote:
> >
> > Hi Tom,
> > I've been working on my own version of KMotionCNC. While adding separate colors for arc commands, I discovered this problem.
> > It looks like the part coordinates are fed into the G Viewer, however if you are using tool length compensation, then the part moves are offset in the Z axis by the tool length. The result is what you see aren't tool tip paths any more. The tool length needs to be added to the Z coordinates fed into the GViewer.
> > Eric
> >
>
> It looks like adding this to the three viewer callback functions fixes it:
> z += TheFrame->GCodeDlg.Interpreter->p_setup->tool_length_offset;
>
> Let me know if I'm using the correct variable for the offset.
>